package com.ocom.human.controller;


import com.github.pagehelper.PageInfo;
import com.ocom.common.constant.HumanServiceUrl;
import com.ocom.common.entity.human.EntityPersonnelInfo;
import com.ocom.common.request.human.StudentsDetailRequest;
import com.ocom.common.request.human.StudentsOndaysRequest;
import com.ocom.common.request.human.StudentsOnlineRequest;
import com.ocom.common.resp.Result;
import com.ocom.common.utils.ResultUtil;
import com.ocom.common.vo.human.KqStudentVo;
import com.ocom.human.service.MjKaoqinService;
import com.ocom.human.service.PersonnelInfoService;
import com.ocom.redis.util.RedisUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;


@RestController
public class PersonFormsController {
    private final Logger log = LoggerFactory.getLogger(PersonFormsController.class);
    @Autowired
    private PersonnelInfoService personnelInfoService;


    @Autowired
    private MjKaoqinService mjKaoqinService;



    @Resource
    private RedisUtil redisUtil;

    @PostMapping(HumanServiceUrl.URL_getKqAndStudentsOnline)
    public Result<List<KqStudentVo>> getKqAndStudentsOnline(@RequestBody StudentsOnlineRequest request) {
        return ResultUtil.success(  personnelInfoService.getKqAndStudentsOnline(request.getComId(),request));


    }

    @PostMapping(HumanServiceUrl.URL_getKqAndStudentsDetail)
    public Result getKqAndStudentsDetail(@RequestBody StudentsDetailRequest request) {

        return ResultUtil.success(  personnelInfoService.getKqAndStudentsDetail(request.getComId(),request));
    }


    @PostMapping(HumanServiceUrl.URL_getKqAndStudentsOndays)
    public Result<PageInfo<EntityPersonnelInfo>> getKqAndStudentsOndays(@RequestBody StudentsOndaysRequest request) {

        return ResultUtil.success();

    }



}


